<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>微信支付样例-订单查询</title>
    <style>
        table{ width: 85%; margin: 0 auto;}
        th{ background: #dcdcdc;}
        th,td{ text-align: center; padding: 4px 0;}
    </style>
    <!--<script type="text/javascript" src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>-->
</head>
<body>
<form action="__ACTION__" method="post">
    <div style="margin-left:2%;color:#f00">记录在本地数据库的微信订单号查询：</div><br/>
    <div style="margin-left:2%;">商品类型：</div><br/>
    <select type="" style="width:96%;height:35px;margin-left:2%;" name="product_type">
        <option value="测试">测试</option>
        <option value="物业费">物业费</option>
        <option value="购买水果">购买水果</option>
    </select><br /><br />
    <div style="margin-left:2%;">支付完成时间段：格式（20160203）</div><br/>
    <input type="text" style="width:96%;height:35px;margin-left:2%;" name="start" /><br /><br />
    <input type="text" style="width:96%;height:35px;margin-left:2%;" name="end" /><br /><br />
    <div style="margin-left:2%;">用户openid：</div><br/>
    <input type="text" style="width:96%;height:35px;margin-left:2%;" name="openid" /><br /><br />
    <div style="margin-left:2%;">是否为已成功交易：</div><br/>
    <div style="margin-left:2%;">
        是<input type="radio" checked="checked" name="trade_state" value="SUCCESS" />
        否<input type="radio" name="trade_state" value="FAIL" />
    </div>
    <div align="center">
        <input type="submit" value="查询" style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" />
    </div>
</form>
<notdefined name="page">
    <if condition="isset($data)">
        <table>
            <tbody>
            <tr>
                <volist name="return_param" id="vo">
                    <if condition="array_search($key, array('','openid','is_subscribe','trade_type','total_fee','transaction_id','out_trade_no','time_end','product_type','is_enough','trade_state'))">
                        <th>{$vo}</th>
                    </if>
                </volist>
                <th>操作</th>
            </tr>
            <volist name="data" id="vo">
                <tr>
                    <volist name="vo" id="voo">
                        <if condition="array_search($key, array('','openid','is_subscribe','trade_type','total_fee','transaction_id','out_trade_no','time_end','product_type','is_enough','trade_state'))">
                            <if condition="$key == 'is_subscribe'">
                                <if condition="$voo == Y">
                                    <td>关注</td>
                                    <else /><td>未关注</td>
                                </if>
                                <elseif condition="$key == 'trade_type'" />
                                <td>{$voo}</td>
                                <elseif condition="$key == 'total_fee'" />
                                <td>{$voo/100}元</td>
                                <elseif condition="$key == 'is_enough'" />
                                    <if condition="$voo == 'Y'">
                                        <td>是</td>
                                        <else /><td>否</td>
                                    </if>
                                <elseif condition="$key == 'time_end'" />
                                <td>{$voo}</td>
                                <elseif condition="$key == 'trade_state'" />
                                    <if condition="$voo == 'SUCCESS'">
                                        <td>成功</td>
                                        <else /><td>未成功</td>
                                    </if>
                                <else /><td>{$voo}</td>
                            </if>

                        </if>
                    </volist>
                    <td><a href="{:U('Query/wxorder',array('transaction_id'=>$vo['transaction_id']))}">微信端详情</a></td>
                </tr>
            </volist>
            </tbody>
        </table>
        <gt name="page" value="1">
            <a href="{:U('Query/localorder',array('page'=>1,'where'=>$where))}">第1页</a>
        </gt>
        <gt name="page" value="2">
            <a href="{:U('Query/localorder',array('page'=>$page-1,'where'=>$where))}">第{$page-1}页</a>
        </gt>
        <span>第{$page}页</span>
        <lt name="page" value="$count-1">
            <a href="{:U('Query/localorder',array('page'=>$page+1,'where'=>$where))}">第{$page+1}页</a>
        </lt>
        <lt name="page" value="$count">
            <a href="{:U('Query/localorder',array('page'=>$count,'where'=>$where))}">第{$count}页</a>
        </lt>
        <span> / 共{$count}页</span>
    </if>
</notdefined>
</body>
</html>